package controlLayer;

import java.util.ArrayList; 
import modelLayer.*;
import java.util.*;

public class StaffController
{
    private StaffContainer staffContainer;
    
    public StaffController(){
        staffContainer = StaffContainer.getInstance();
    }
    
   public Staff findStaffByUserName(String username){
        ArrayList<Staff> staffs = StaffContainer.getInstance().getAllStaff();
        for(Staff s : staffs){
            if(s.getUsername().equals(username))
                return s;
        }
        return null;
    }
    
   public void addStaff(Staff username) {
       staffContainer.addStaff(username);
    }
    
   public boolean removeStaff(Staff username) {
     return  staffContainer.removeStaff(username);
    }
    
   public void printStaffInfo (String username) {
       staffContainer.printStaffInfo(username);
    }
    
   public void printAllStaffInfo() {
       staffContainer.printAllStaffInfo();
    }
   
   public ArrayList<Staff> getAllStaff() {
       return StaffContainer.getInstance().getAllStaff();
    }
    
   public Staff getStaff (String username) {
    return StaffContainer.getInstance().getStaff(username);
    }
    
   public void updateStaff(Staff staff, String name, String phoneNo, int cprNo, String username, String password, boolean isManager){
      StaffContainer.getInstance().updateStaff(staff,name,phoneNo,cprNo,username,password,isManager);
   }
   
}
